package io.renren.modules.eightapp.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.renren.modules.eightapp.dao.EiComplainInfoDao;
import io.renren.modules.eightapp.dao.EiManagerInfoDao;
import io.renren.modules.eightapp.entity.EiComplainInfoEntity;
import io.renren.modules.eightapp.entity.EiManagerInfoEntity;
import io.renren.modules.eightapp.service.EiComplainService;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class EiComplainServiceImpl implements EiComplainService {
    @Autowired
    private EiComplainInfoDao eiComplainInfoDao;
    @Autowired
    EiManagerInfoDao eiManagerInfoDao;

    @Override
    public List<EiManagerInfoEntity> getComplainList() {
        QueryWrapper<EiManagerInfoEntity> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().select();
        List<EiManagerInfoEntity> list = eiManagerInfoDao.selectList(queryWrapper);
        return list;
    }

    @Override
    public int updateStateById(Integer id) {
        EiComplainInfoEntity eiComplainInfoEntity = new EiComplainInfoEntity();
        eiComplainInfoEntity.setState(1);
        eiComplainInfoEntity.setId(id);
        int i = eiComplainInfoDao.updateById(eiComplainInfoEntity);
        return i;
    }
}
